package main.java.FSMDE.models;

public enum ComponentType {
	Generic("Generic", 0), Text_field("Text field", 1), CheckBox("Check box", 2), RadioButton(
			"Radio button", 3), Text("Text", 4), URL("URL", 5), Section(
			"Section", 6), Image("Image", 7), Player("Player", 8), Tab("Tab", 9), Accordion(
			"Accordion", 10), Slider("Slider", 11), Unsorted_List(
			"Unsorted list", 12), Drop_Down_list("Drop-down list", 13), Table(
			"Table", 14), Heading("Heading", 15), Form("Form", 16), Button(
			"Button", 17);

	private String description;
	private int id;

	ComponentType(String name, int id) {
		this.description = name;
		this.id = id;
	}

	@Override
	public String toString() {

		return this.description;
	}

	public int getId() {
		return this.id;
	}

	public static ComponentType valueOfByDescription(String description) {
		for (ComponentType type : values()) {
			if (type.description.equals(description))
				return type;
		}
		return null;
	}
}
